Page({
  data: {
  },
  onLoad: function() {
      this.read()
  },
  read: function() {
    this.setData({
      key: wx.getStorageSync("key"),
      secret: wx.getStorageSync("secret"),
      principal: wx.getStorageSync("principal")
    });
  },
  save: function(e) {
    var config = e.detail.value;
    for (const k in config) {
      wx.setStorageSync(k, config[k]);
    }
    wx.showModal({
      title: "保存成功",
      showCancel: false,
      success: res => {
        wx.reLaunch({
          url: "../../trade/index/index"
        });
      }
    });
  },
});
